package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.purchasingplanDetailsServerImpl;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
/*订单明细表接口*/
@RestController
@RequestMapping("/purls")
public class PurchasingplanDetailsController {
    @Autowired
    purchasingplanDetailsServerImpl purls;

    @RequestMapping("/getAllpurls")
    public Object getAllpurls(@RequestParam Map<String, Object> map) {
        Integer limit = Integer.parseInt(map.get("limit").toString());
        Integer page = Integer.parseInt(map.get("page").toString());
        map.put("limit", limit);
        map.put("page", (page - 1) * limit);
        Result result = new Result("0", "true", purls.countFind(map), purls.getAllpurls(map));
        return result;
    }
}
